import java.io.File;

public class FileDemo1 {
    public static void main(String[] args) {
        File pFile=new File("d:\\");
        //构造方法1
        File file=new File(pFile,"a.txt");
        System.out.println(file.getPath());

        //构造方法2【重点】
        File file1=new File("d:\\b.txt");
        System.out.println("文件1路径："+file1.getPath());

        //构造方法3
        File file2=new File("d:\\","c.txt");
        System.out.println(file2.getPath());

    }
}
